package com.neusoft.neuiotms.dcom.converter;

import org.springframework.stereotype.Component;

import com.neusoft.bizcore.web.dto.AbstractConverter;
import com.neusoft.neuiotms.dcom.dto.KnowledgeKeywordsDTO;
import com.neusoft.neuiotms.dcom.model.KnowledgeKeywords;

@Component
public class KnowledgeKeywordsConverter extends AbstractConverter<KnowledgeKeywords, KnowledgeKeywordsDTO> {

    @Override
    public KnowledgeKeywords toModel(final KnowledgeKeywordsDTO dto) {
        final KnowledgeKeywords model = new KnowledgeKeywords();
        model.setName(dto.getName());
        return model;
    }

    @Override
    public KnowledgeKeywordsDTO toDTO(final KnowledgeKeywords model, final boolean forListView) {
        final KnowledgeKeywordsDTO dto = new KnowledgeKeywordsDTO();
        dto.setId(model.getId());
        dto.setName(model.getName());
        return dto;
    }

}
